/*
 *  Player.h
 *  MapEdit
 *
 *  Created by Steven Canfield on 7/5/07.
 *
 */

#include <Cocoa/Cocoa.h>

#pragma options align=packed
struct chk_iown_t {
	u_int8_t players[12]; // 1 byte per player, 03 = rescuable, 05 = computer, 06 = human, 07 = neutral
};
typedef struct chk_iown_t chk_iown_t;

struct chk_ownr_t {
	u_int8_t players[12]; // 1 byte per player, 00 = not used in scenario, 03 = rescuable, 05 = computer, 06 = human, 07 = neutral
};
typedef struct chk_ownr_t chk_ownr_t;

struct chk_side_t {
	u_int8_t race[12];
	/*
	00 - Zerg
	01 - Terran
	02 - Protoss
	03 - Independent
	04 - Neutral
	05 - User Select
	07 - Inactive
	10 - Human
	*/
};
typedef struct chk_side_t chk_side_t;

struct chk_forc_t {
	u_int8_t force[8];
	u_int16_t name[4];
	u_int8_t flags[4];
};
typedef struct chk_forc_t chk_forc_t;

void swap_chk_forc( chk_forc_t * forc );

struct chk_puni_t {
	u_int8_t		player[228 * 12];
	u_int8_t		global[228];
	u_int8_t  uses_default[228 * 12];
};
typedef struct chk_puni_t chk_puni_t;

/* Upgrades */
struct chk_upgr_t {
	u_int8_t override_max_level[45][12];
	u_int8_t override_base_level[45][12];
	u_int8_t default_max_level[45];
	u_int8_t default_base_level[45];
	u_int8_t player_uses_override[45][12];
};
typedef struct chk_upgr_t chk_upgr_t;

/* Brood War Version */
struct chk_pupx_t {
	u_int8_t override_max_level[61][12];
	u_int8_t override_base_level[61][12];
	u_int8_t default_max_level[61];
	u_int8_t default_base_level[61];
	u_int8_t player_uses_override[61][12];
};
typedef struct chk_pupx_t chk_pupx_t;

/* Player Technology Restrictions */
struct chk_ptec_t {
	u_int8_t override_available[24][12];
	u_int8_t override_researched[24][12];
	u_int8_t default_available[24];
	u_int8_t default_researched[24];
	u_int8_t player_uses_override[24][12];
};
typedef struct chk_ptec_t chk_ptec_t;

/* Brood War Version */
struct chk_ptex_t {
	u_int8_t override_available[44][12];
	u_int8_t override_researched[44][12];
	u_int8_t default_available[44];
	u_int8_t default_researched[44];
	u_int8_t player_uses_override[44][12];	
};
typedef struct chk_ptex_t chk_ptex_t;

/* Color */
struct chk_colr_t {
	u_int8_t player_color[8];
};
typedef struct chk_colr_t chk_colr_t;
